package com.ruoyi.accountant.service.impl;

import com.ruoyi.accountant.dao.CurrencyDao;
import com.ruoyi.accountant.domain.Currency;
import com.ruoyi.accountant.domain.CurrencyExample;
import com.ruoyi.accountant.mapper.CurrencyMapper;
import com.ruoyi.accountant.service.CurrencyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class CurrencyServiceImpl implements CurrencyService {
    //@Autowired
//    private CurrencyDao currencyService;

    @Autowired
    private CurrencyMapper currencyMapper;
    @Override
    public List<Currency> findAll() {
        return currencyMapper.selectByExample(null);
    }

    @Override
    public Currency findById(Integer currency) {
        return currencyMapper.selectByPrimaryKey(currency);
    }

    @Override
    public Currency findByEnName(String currencyName) {
        return currencyMapper.findByEnName(currencyName);
    }
}
